<?php
include 'konek.php';


if($_GET['stat']=='guru')
{
	$status=$_GET['stat'];
	$user2=$_GET['email'];
	if(preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i", $user2))
	{

		$mysql2=mysql_query("SELECT * from guru where email LIKE '$user2%' ");
		while($d=mysql_fetch_assoc($mysql2))
		{
			echo "ada";
		}
	}
	else
	{
		echo "salah";
	}
		
}


if($_GET['stat']=='siswa')
{

	$status=$_GET['stat'];
	$user=$_GET['email'];
if(preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i", $user))
	{	
		$mysql=mysql_query("SELECT * from siswa where email_sis LIKE '$user%'");
		while($x=mysql_fetch_assoc($mysql))
		{
			echo "ada";
		}
	}
	else
	{
		echo "salah";	
	}
	
	
	
}